package com.example.survey23.controller;


import com.example.survey23.entity.AnswerBankRadio;
import com.example.survey23.service.AnswerBankRadioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 23Group
 * @since 2022-11-10
 */
@RestController
@RequestMapping("/answer-bank-radio")
public class AnswerBankRadioController {
    @Autowired
    AnswerBankRadioService answerBankRadioService;
    public void save(AnswerBankRadio answerBankRadio){
        answerBankRadioService.save(answerBankRadio);
    }

    // 批量保存单选选项
    public void saveList(List<AnswerBankRadio> list){
        for (int i=0; i<list.size(); i++){
            answerBankRadioService.save(list.get(i));
        }
    }

    public int getMaxRId(){
        return answerBankRadioService.getMaxRId();
    }
}
